﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace CSharpProj.MyExpression
{
    /// <summary>
    /// 列表达式
    /// </summary>
    public class ColumnExpression : Expression
    {
        public ColumnExpression(Type type, Expression value, string selectAlias, string columnName, int index)
            : base((ExpressionType)DbExpressionType.Column, type)
        {
            SelectAlias = selectAlias;
            ColumnName = columnName;
            Index = index;
            Value = value;
        }

        #region 属性

        /// <summary>
        /// 值表达式
        /// </summary>
        public Expression Value { get; set; }

        /// <summary>
        /// 归属的查询表达式的别名
        /// </summary>
        public string SelectAlias { get; set; }

        /// <summary>
        /// 列名
        /// </summary>
        public string ColumnName { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Index { get; set; }

        #endregion
    }
}
